﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace LULSMS_WServices
{
    /// <summary>
    /// Summary description for ConnectionService
    /// </summary>
    [WebService(Namespace = "http://LULSMS/ConnectionService")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class ConnectionService : System.Web.Services.WebService
    {

        [WebMethod]
        public string createConnection(string ip, string userName, string password)
        {
            return LULSMS.SessionManager.createConnection(ip, userName, password, "LULSMS");
        }

        [WebMethod]
        public string createSession(string patient, string userName, string password)
        {
            return LULSMS.SessionManager.createSession(patient, userName, password, "LULSMS");
        }

        [WebMethod]
        public string endConnection(string userName, string password)
        {
            return LULSMS.SessionManager.updateConnection(userName, password, "LULSMS");
        }

        [WebMethod]
        public string endSession(string patient,string userName, string password)
        {
            return LULSMS.SessionManager.updateSession(patient, userName, password, "LULSMS");
        }

        [WebMethod]
        public LULSMS_Lib.User restoreSession(string user, string userName, string password)
        {
            return LULSMS.SessionManager.restoreSession(user, userName, password, "LULSMS");
        }
    }
}
